package aloyii.demo3.after;

/**
 * @Author yajing zhu
 * @Date 2024/10/25 16:13
 * @Version 1.0
 * @注释： 计算机用例
 */
public class ComputerDemo {
    
    public static void main(String[] args) {
        //创建计算机的组件对象
        HardDisk hardDisk = new XiJieHardDisk();
        Cpu cpu = new IntelCpu();
        Memory memory = new KingstonMemory();
        
        //创建计算机对象
        Computer computer = new Computer();
        //组装计算机
        computer.setCpu(cpu);
        computer.setMemory(memory);
        computer.setHardDisk(hardDisk);
        
        //运行计算机
        computer.run();
    }
    
    
    
}
